﻿#ifndef SNAKE_H
#define SNAKE_H

#include <QObject>
#include<QPoint>
#define MAX_LEN 30   //蛇的最大长度

class Snake : public QObject
{
    Q_OBJECT
    enum  DIR{UP,DOWN,LEFT,RIGHT};   //蛇的方向
public:
    QPoint points[MAX_LEN];     //蛇的位置坐标
    int len;    //蛇的长度
    DIR dir;    //蛇的方向
    void updatePos();

public:
    explicit Snake(QObject *parent = nullptr);

signals:

public slots:
};

#endif // SNAKE_H
